#include <iostream>
#include "Vehicle.h"
#include "vehicleRegister.h"
#include <string>


using namespace std;

void main1()
{
	Vehicle v1;
	Vehicle v2("Volvo" ,1990, 7000, 12000);
	cout << v1.GetBrand() <<"," << v1.GetYear() <<"," << v1.GetPurchasingPrice() << ", " <<v1.GetSellinPrice() << endl;
	cout << v2.GetBrand() <<"," << v2.GetYear() <<"," << v2.GetPurchasingPrice() << ", " <<v2.GetSellinPrice() << endl;
	v1.SetBrand("Toyota");
	v1.SetYear(2000);
	v1.SetPurchasingPrice(15000);
	v1.SetSellingPrice(20000);
	cout << v1.GetBrand() <<"," << v1.GetYear() <<"," << v1.GetPurchasingPrice() << ", " <<v1.GetSellinPrice() << endl;
	system("pause");
}
void main2()
{
	Vehicle v1;
	Vehicle v2("Volvo" ,1990, 7000, 12000);
	v1.Write();
	v2.Write();
	v1.Read();
	v1.Write();
	system("pause");
}

void main3()
{
	Vehicle v1;
	Vehicle v2("Volvo" ,1990, 7000, 12000);
	cout << v1 << endl;
	cout << v2 <<endl;
	cin >> v1;
	cout << v1 << endl;
	system("pause");
}
void main4()
{
	Vehicle v1("Volvo" ,1990, 7000, 12000);
	Vehicle v2("Toyota" ,2010, 15000, 2000);
	Vehicle v3("Peugeot" ,2002, 1000, 13000);
	vehicleRegister vr;
	vr.Add(v1);
	vr.Add(v2);
	vr.Add(v3);
	cout << vr.List() <<endl;
	vr.Delete(v3);
	
	cout << vr.List() <<endl;


	system("pause");
}
void main5()
{
	Vehicle v1("Volvo" ,1990, 7000, 12000);
	Vehicle v2("Toyota" ,2010, 15000, 2000);
	Vehicle v3("Peugeot" ,2002, 1000, 13000);
	vehicleRegister vr;
	vr.Add(v1);
	vr.Add(v2);
	vr.Add(v3);
	cout << vr.List() <<endl;
	vr.WriteToFile();
	system("pause");
}
void main6()
{
	vehicleRegister vr;
	vr.ReadFromFile();
	cout << vr.List() << endl;

	system("pause");
}
void main7()
{
	vehicleRegister vr;
	vr.ReadFromFile();
	cout << vr.List() << endl;
	vr.CalculateStorageValue() ;
	cout << "total =" << vr.CalculateStorageValue() <<endl;
	system("pause");
}

int main()
{
	//main1();
	//main2();
	//main3();
	main4();
	//main5();
	//main6();
	//main7();

}